Public Class ScanSchedule_Factory
    Public Function GetScheduleForDatabase( _
                                ByVal lDatabaseID As Long, _
                                ByVal lType As ScanSchedule.Type) As ScanSchedule

        Dim oFactory As New DBScanSchedule_Factory

        Return oFactory.GetScheduleForDatabase(lDatabaseID, lType)
    End Function

    Public Function GetIntervalMinutesForDatabase( _
                                ByVal lDatabaseID As Long, _
                                ByVal lType As ScanSchedule.Type) As Long

        Dim lIntervalMinutes As Long = ScanSchedule.NODATA

        Dim oScheduleFactory As New DBScanSchedule_Factory
        Dim oScanSchedule As ScanSchedule = Nothing

        oScanSchedule = oScheduleFactory.GetScheduleForDatabase(lDatabaseID, lType)
        If oScanSchedule Is Nothing Then
            Dim oDefaultScheduleFactory As New ScanScheduleDefault_Factory
            lIntervalMinutes = oDefaultScheduleFactory.GetDefaultIntervalMinutes(lType)
        Else
            lIntervalMinutes = oScanSchedule.ScanTypeMinutes
        End If

        Return lIntervalMinutes
    End Function

    Public Function GetReportRequestedForDatabase( _
                                ByVal lDatabaseID As Long, _
                                ByVal lType As ScanSchedule.Type) As Boolean

        Dim bReportRequested As Boolean = ScanSchedule.NODATA

        Dim oScheduleFactory As New DBScanSchedule_Factory
        Dim oScanSchedule As ScanSchedule = Nothing

        oScanSchedule = oScheduleFactory.GetScheduleForDatabase(lDatabaseID, lType)
        If Not oScanSchedule Is Nothing Then
            bReportRequested = oScanSchedule.SendReport
        End If

        Return bReportRequested
    End Function
End Class
